package cn.ichiva.dl.tushare.analy.rt;

import cn.ichiva.common.io.IOHelper;
import cn.ichiva.dl.tushare.analy.impl.Trade;
import cn.ichiva.dl.tushare.analy.impl.TradeAgent;
import org.deeplearning4j.nn.multilayer.MultiLayerNetwork;

import java.io.File;
import java.io.IOException;

/**
 * 神经网络模型导出
 *
 * 下一步补充训练
 */
public class ReportNetWork {

    public static void main(String[] args) throws IOException, ClassNotFoundException {
        File file = new File("/Volumes/Chiva/git/gitee/wall-street-server/data/000001.sz/P2G2N12149V146913-151737-135706.ai");
        TradeAgent agent = (TradeAgent) IOHelper.readObject(file);
        MultiLayerNetwork network = agent.getMultiLayerNetwork();

        File objFile = new File(file.getParentFile(), "network.obj");
        IOHelper.writeObject(objFile,network);

        Trade trade = new Trade();
        IOHelper.writeObject(new File(file.getParentFile(),"trade.obj"),trade);
    }
}
